package com.longxi.tianjintianbao.ui.activity.work;

import android.support.v7.widget.RecyclerView;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.ui.base.BaseActivity;
import com.longxi.tianjintianbao.ui.presenter.work.WorkLayoutAtPresenter;
import com.longxi.tianjintianbao.ui.view.work.IWorkLayoutAtView;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;

public class WorkLayoutActivity extends BaseActivity<IWorkLayoutAtView, WorkLayoutAtPresenter> implements IWorkLayoutAtView {

    private final String TAG = "WorkLayoutActivity";

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_work_layout;
    }

    @Override
    public void initData() {
        super.initData();
        mPresenter.setBar();
        mPresenter.initAdapter();

    }

    @Override
    public void initListener() {
        super.initListener();
        mPresenter.getWorkList();
        mIvRight.setOnClickListener(v -> mPresenter.OneButtonDialog("长按可拖动功能模块进行排序,右边切换按钮打开(蓝色)表示工作页面可见,关闭(灰色)工作页面不可见."));
    }

    @Override
    protected WorkLayoutAtPresenter createPresenter() {
        return new WorkLayoutAtPresenter(this);
    }

    @Override
    public SmartRefreshLayout getRefreshLayout() {
        return mRefreshLayout;
    }

    @Override
    public RecyclerView getRvContent() {
        return mRvContent;
    }

    @Override
    protected void onDestroy() {
        mPresenter.onDestroy();
        super.onDestroy();
    }
}
